Rename XENFEAT_ring0_kernel to slightly more generic XENFEAT_supervisor_mode_kernel.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 23 Feb 2006 10:59:27 +0000 (11:59 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 23 Feb 2006 10:59:27 +0000 (11:59 +0100)
Add comments in public header version.h to explain what all the different
feature flags mean. Add a new flag XENFEAT_pae_pgdir_above_4gb to inform the guest
that its PAE page directories do not need to conform to the usual hardware
restriction.

Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S
linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c
linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/segment.h
xen/common/kernel.c
xen/include/public/version.h

index a7cb4c8dd8a02ca6971afa55b616ee096d24ba08..6d3bee09fcab6f9c1336bf2c24cd3aaf40865cb9 100644 (file)
@@ -182,7 +182,7 @@ ENTRY(_stext)
        .ascii  ",FEATURES=writable_page_tables"
        .ascii           "|writable_descriptor_tables"
        .ascii           "|auto_translated_physmap"
-       .ascii           "|ring0_kernel"
+       .ascii           "|supervisor_mode_kernel"
 #ifdef CONFIG_X86_PAE
        .ascii  ",PAE=yes"
 #else
index 12d79adb64425705e271f44767f5cc7da727f25d..923ad17df503700aa8410301e4e5c2fae3ded57e 100644 (file)
@@ -289,10 +289,11 @@ void pgd_ctor(void *pgd, kmem_cache_t *cache, unsigned long unused)
        unsigned long flags;
 
        if (PTRS_PER_PMD > 1) {
-               /* Ensure pgd resides below 4GB. */
-               int rc = xen_create_contiguous_region(
-                       (unsigned long)pgd, 0, 32);
-               BUG_ON(rc);
+               if (!xen_feature(XENFEAT_pae_pgdir_above_4gb)) {
+                       int rc = xen_create_contiguous_region(
+                               (unsigned long)pgd, 0, 32);
+                       BUG_ON(rc);
+               }
                if (HAVE_SHARED_KERNEL_PMD)
                        memcpy((pgd_t *)pgd + USER_PTRS_PER_PGD,
                               swapper_pg_dir + USER_PTRS_PER_PGD,
index b736fbac7a2d281dc8eb48033584a3e3ac5ed781..96a509c93e04fe00b03ddef1a8e27f43cc0cd287 100644 (file)
 
 #define GDT_ENTRY_KERNEL_CS            (GDT_ENTRY_KERNEL_BASE + 0)
 #define __KERNEL_CS (GDT_ENTRY_KERNEL_CS * 8)
-#define GET_KERNEL_CS() (__KERNEL_CS | (xen_feature(XENFEAT_ring0_kernel)?0:1) )
+#define GET_KERNEL_CS() (__KERNEL_CS | (xen_feature(XENFEAT_supervisor_mode_kernel)?0:1) )
 
 #define GDT_ENTRY_KERNEL_DS            (GDT_ENTRY_KERNEL_BASE + 1)
 #define __KERNEL_DS (GDT_ENTRY_KERNEL_DS * 8)
-#define GET_KERNEL_DS() (__KERNEL_DS | (xen_feature(XENFEAT_ring0_kernel)?0:1) )
+#define GET_KERNEL_DS() (__KERNEL_DS | (xen_feature(XENFEAT_supervisor_mode_kernel)?0:1) )
 
 #define GDT_ENTRY_TSS                  (GDT_ENTRY_KERNEL_BASE + 4)
 #define GDT_ENTRY_LDT                  (GDT_ENTRY_KERNEL_BASE + 5)
index bbe66a4ede9a5d07e695657b8fec8d6fd4e33f75..56f2c21abfaffd60e1808a126feac49af9d6a672 100644 (file)
@@ -193,7 +193,8 @@ long do_xen_version(int cmd, void *arg)
             if ( shadow_mode_translate(current->domain) )
                 fi.submap |= 
                     (1U << XENFEAT_writable_page_tables) |
-                    (1U << XENFEAT_auto_translated_physmap);
+                    (1U << XENFEAT_auto_translated_physmap) |
+                    (1U << XENFEAT_pae_pgdir_above_4gb);
             break;
         default:
             return -EINVAL;
index 55c5e8d147440b77e92d0bbd3dfe92578319ca88..5b68673d5486332c255884ab8c35b7b1ea58e6ab 100644 (file)
@@ -48,10 +48,34 @@ typedef struct xen_feature_info {
     uint32_t     submap;        /* OUT: 32-bit submap */
 } xen_feature_info_t;
 
+/*
+ * If set, the guest does not need to write-protect its pagetables, and can
+ * update them via direct writes.
+ */
 #define XENFEAT_writable_page_tables       0
+
+/*
+ * If set, the guest does not need to write-protect its segment descriptor
+ * tables, and can update them via direct writes.
+ */
 #define XENFEAT_writable_descriptor_tables 1
+
+/*
+ * If set, translation between the guest's 'pseudo-physical' address space
+ * and the host's machine address space are handled by the hypervisor. In this
+ * mode the guest does not need to perform phys-to/from-machine translations
+ * when performing page table operations.
+ */
 #define XENFEAT_auto_translated_physmap    2
-#define XENFEAT_ring0_kernel               3
+
+/* If set, the guest is running in supervisor mode (e.g., x86 ring 0). */
+#define XENFEAT_supervisor_mode_kernel     3
+
+/*
+ * If set, the guest does not need to allocate x86 PAE page directories
+ * below 4GB. This flag is usually implied by auto_translated_physmap.
+ */
+#define XENFEAT_pae_pgdir_above_4gb        4
 
 #define XENFEAT_NR_SUBMAPS 1